import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_svg/svg.dart';

class Home extends StatefulWidget {
  const Home({Key? key}) : super(key: key);

  @override
  State<Home> createState() => _HomeState();
}

class _HomeState extends State<Home> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        body: Stack(
      children: [
        Positioned.fill(
          child: SvgPicture.asset("assets/svgs/3.svg", fit: BoxFit.cover),
        ),
        Align(
          alignment: Alignment.topLeft,
          child: Padding(
            padding: EdgeInsets.only(top: 85.w, left: 22.w),
            child: Text(
              "我的时间戳",
              style: TextStyle(fontSize: 24.sp, color: const Color(0xFF162D58)),
            ),
          ),
        ),
        Positioned(
          top: 124.w,
          left: 22.w,
          child: Text(
            "开启：你的时间管理基地 ﹥",
            style: TextStyle(fontSize: 12.sp, color: const Color(0xFFB3B3B3)),
          ),
        ),
        Positioned(
          top: 188.w,
          left: 22.w,
          child: SvgPicture.asset("assets/svgs/5bg.svg",
              width: 331.w, height: 291.w),
        ),
        Positioned(
          top: 81.w,
          left: 171.w,
          child: Image.asset(
            "assets/images/4.png",
            width: 182.w,
            height: 168.w,
            fit: BoxFit.cover,
          ),
        ),
        Positioned(
            top: 209.w,
            left: 41.w,
            child: Text(
              "新人专享权益",
              style: TextStyle(fontSize: 20.sp, color: const Color(0xFF3B84FF)),
            )),
        Positioned(
            top: 248.w,
            left: 27.w,
            child: Container(
              width: 321.w,
              height: 226.w,
              //圆角10
              decoration: BoxDecoration(
                color: const Color(0xFFFEFFFF),
                borderRadius: BorderRadius.circular(10),
              ),
            )),
        _buildCard()
      ],
    ));
  }

  Widget _buildCard() {
    return Stack(children: [
      Positioned(
        top: 273.w,
        left: 43.w,
        child: Image.asset(
          "assets/images/8.png",
          fit: BoxFit.fill,
        ),
      ),
      Positioned(
        top: 276.w,
        left: 97.w,
        child: Text(
          "免费创建时间戳",
          style: TextStyle(fontSize: 16.sp, color: const Color(0xFF162D58)),
        ),
      ),
      Positioned(
        top: 300.w,
        left: 97.w,
        child: Text("更好的管理属于自己的时间",
            style: TextStyle(fontSize: 12.sp, color: const Color(0xFFB3B3B3))),
      ),
      Positioned(
          top: 283.w,
          left: 308.w,
          child:
              SvgPicture.asset("assets/svgs/7.svg", width: 23.w, height: 23.w)),
      Positioned(
        top: 343.w,
        left: 43.w,
        child: Image.asset(
          "assets/images/6.png",
          fit: BoxFit.fill,
        ),
      ),
      Positioned(
        top: 346.w,
        left: 97.w,
        child: Text(
          "赠送精品课程",
          style: TextStyle(fontSize: 16.sp, color: const Color(0xFF162D58)),
        ),
      ),
      Positioned(
        top: 370.w,
        left: 97.w,
        child: Text("大咖讲师传授效率技巧",
            style: TextStyle(fontSize: 12.sp, color: const Color(0xFFB3B3B3))),
      ),
      Positioned(
          top: 353.w,
          left: 308.w,
          child:
              SvgPicture.asset("assets/svgs/7.svg", width: 23.w, height: 23.w)),
      Positioned(
        top: 413.w,
        left: 43.w,
        child: Image.asset(
          "assets/images/5.png",
          fit: BoxFit.fill,
        ),
      ),
      Positioned(
        top: 416.w,
        left: 97.w,
        child: Text(
          "积分奖励",
          style: TextStyle(fontSize: 16.sp, color: const Color(0xFF162D58)),
        ),
      ),
      Positioned(
        top: 440.w,
        left: 97.w,
        child: Text("注册即可获得 20 个积分",
            style: TextStyle(fontSize: 12.sp, color: const Color(0xFFB3B3B3))),
      ),
    ]);
  }
}
